home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / C for beginners.adf / source / copystr.c < prev    next >
C/C++ Source or Header  |  1978-01-17  |  419b  |  24 lines

  1. /* copysrt.c  12.3.1 */
  2. #define EOS '\0'
  3. #define MAXLEN 81
  4.  
  5. strcpy(to,from)
  6. char to[], from[];
  7. {
  8.    int i = 0;
  9.    while((to[i] = from[i]) != EOS)
  10.    i++;
  11. }
  12.  
  13. main()
  14. {
  15.    char s1[MAXLEN], s2[MAXLEN], s3[MAXLEN];
  16.  
  17. printf("Your name, please\n");
  18.    scanf("%40s", s1);
  19.    strcpy(s3, s1);
  20.    strcpy(s2, "TEXT IN s2");
  21. printf("Therefore %s, in s2 is \"%s\".", s1 ,s2);
  22. printf(" I hope %s, that everything is clear!\n", s3);
  23. }
  24.